package com.gigi.datageniebackendmaster.model.enums;

/**
 * 错误码枚举
 *
 * @author Gigi
 */
public enum ErrorCodeEnum {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(400, "请求参数错误"),
    NOT_LOGIN_ERROR(401, "未登录"),
    NO_AUTH_ERROR(403, "无权限"),
    NOT_FOUND_ERROR(404, "请求数据不存在"),
    SYSTEM_ERROR(500, "系统内部异常"),
    OPERATION_ERROR(501, "操作失败"),
    TOO_MANY_REQUESTS_ERROR(429, "请求过于频繁"),
    SYSTEM_BUSY_ERROR(503, "系统繁忙");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
